Soon we will properly handle paged out memory in this function by
sleeping in hypervisor context. This will require that all callers can
sleep.
If this check is too strong, we can reduce it to only applying to
guests with paging enabled (which also currently implies only guests
using Intel EPT). However my brief testing seems to indicate it works
okay.
Signed-off-by: Keir Fraser <keir@xen.org>
char *p;
int count, todo = size;
+ /*
+ * If the required guest memory is paged out, this function may sleep.
+ * Hence we bail immediately if called from atomic context.
+ */
+ if ( in_atomic() )
+ return HVMCOPY_unhandleable;
+
while ( todo > 0 )
{
count = min_t(int, PAGE_SIZE - (addr & ~PAGE_MASK), todo);